import request from '@/utils/request'

// 查询考核码列表
export function listCode(query) {
  return request({
    url: '/kh/code/list',
    method: 'get',
    params: query
  })
}

// 查询考核码详细
export function getCode(id) {
  return request({
    url: '/kh/code/' + id,
    method: 'get'
  })
}

// 新增考核码
export function addCode(data) {
  return request({
    url: '/kh/code',
    method: 'post',
    data: data
  })
}

// 修改考核码
export function updateCode(data) {
  return request({
    url: '/kh/code',
    method: 'put',
    data: data
  })
}

// 删除考核码
export function delCode(id) {
  return request({
    url: '/kh/code/' + id,
    method: 'delete'
  })
}

// 导出考核码
export function exportCode(query) {
  return request({
    url: '/kh/code/export',
    method: 'get',
    params: query
  })
}

// 根据考核计划id 可生成考核码 公司列表
export function getDeptCodeList(assessmentId) {
  return request({
    url: '/kh/code/getDeptCodeList/'+assessmentId,
    method: 'get'
  })
}

//生成考核码
export function genCode(data){
  return request({
    url: '/kh/code/genCode',
    method: 'post',
    data: data
  })
}

